FROM openresty/openresty:1.15.8.1-alpine
MAINTAINER NEOWAY ruanjiansanbu@neoway.com

# 创建主目录，应用所有东西全部放在app目录下面
RUN mkdir -p /home/app

# 创建日志目录
RUN mkdir -p /home/app/log

# 创建console文件目录
RUN mkdir -p /home/app/iot-channel-console

# 默认主目录为工作目录
WORKDIR /home/app

# 拷贝console文件
COPY dist /home/app/iot-channel-console

# 拷贝nginx配置文件
COPY docker/nginx.conf /usr/local/openresty/nginx/conf/nginx.conf 
COPY docker/iot-channel.conf /usr/local/openresty/nginx/conf/conf.d/iot-channel.conf

# 暴露默认的HTTP和HTTPS端口
EXPOSE 80 443

# 容器启动时执行的命令
CMD ["nginx", "-g", "daemon off;"]
